package com.yxzx.vod.util;

public class Demo3 {
    public static void main(String[] args) {
// 冒泡排序
        int[] array = {30, 56, 34, 100, 23}; //23,30,34,56,100
        for (int i = 0; i < array.length - 1; i++) {
            for (int j = 0; j < array.length - 1 - i; j++) {
                if (array[j] > array[j + 1]) {
                    int temp = array[j];
                    array[j] = array[j + 1];
                    array[j + 1] = temp;
                }
            }
        }
        System.out.println("\n排序的结果:");
        for (int i : array) {
            System.out.print(i + "\t");
        }
    }
}